﻿using Common.Communal;
using ERP.Domain.CustomerSupplier;
using MediatR;
using Sell.Api.Write.Application.Command.SalesManagementCommand;
using Sell.Services.Verifications;

namespace Sell.Api.Write.Application.CommandHandlers.SalesManagementCommandHandlers
{
    public class VerificationDelCommandHandlers : IRequestHandler<VerificationDelCommand, ApiResult<int>>
    {
        private readonly IVerificationServices Services;
        public VerificationDelCommandHandlers(IVerificationServices _Services)
        {
            Services=_Services;
        }
        /// <summary>
        /// 采购核价删除
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<ApiResult<int>> Handle(VerificationDelCommand request, CancellationToken cancellationToken)
        {
            return await Services.DeleteVerification(request.Id);
        }
    }
}
